/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.j2eem.Mapper.wcymapper;

import com.mycompany.j2eem.Entity.UserMessage;
import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 *
 * @author asus
 */
public interface MessageMapper {
    
    //获取用户未读消息
    @Select("SELECT Account_id,nickname,operation,id from Mymessage where Account_id = #{Account_id}")
    List<UserMessage> get_Mymessage(@Param("Account_id") String Account_id );
    //已读
    @Update("Update User_Message set isread = 1 where id = #{id}")
    int is_read(@Param("id") String id);
    //发送消息
    @Insert("INSERT INTO User_Message(Account_id, Operation_id,Account_id_b,isread,time) value (#{Account_id},#{operation},#{Account_id_b},#{isread},now())")
    int send_message(@Param("Account_id") String Account_id,@Param("operation") String operation,@Param("Account_id_b") String Account_id_b,@Param("isread") String isread);
}
